package common.html;

import java.io.PrintWriter;

public class HtmlWriter
{
    PrintWriter pw;

    public HtmlWriter(PrintWriter pw)
    {
        this.pw = pw;
    }

    public HtmlWriter h1(String context)
    {
        getPw().println(String.format("<h1>%s</h1>", context));
        return this;
    }

    public HtmlWriter hr()
    {
        getPw().println("<hr/>");
        return this;
    }

    public HtmlWriter print(String context)
    {
        getPw().println(context);
        return this;
    }

    public HtmlWriter print(String format, Object... args)
    {
        getPw().println(String.format(format, args));
        return this;
    }

    public PrintWriter getPw()
    {
        return pw;
    }

}
